<?php
/* --------------------------------------------------------------
   iclear_error.php 2008-07-23 gambio
   Gambio OHG
   http://www.gambio.de
   Copyright (c) 2008 Gambio OHG
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------
*/
?><?php

// $Id: iclear_error.php 91 2008-07-23 06:47:55Z  $

  class iclearError {

    var $error = array();

    function iclearError() {
    }

    function isError() {
      return $this->getErrorCount();
    }

    function addError($msg) {
      if(!is_array($this->error)) {
        $this->error = array();
      }
      array_push($this->error, $msg);
    }

    function getErrorCount() {
      $rc = 0;
      if(is_array($this->error)) {
        $rc = sizeof($this->error);
      }
      return $rc;
    }

    function dumpErrorList() {
      if(sizeof($this->error)) {
        print join("\n", $this->error);
      }
    }

    function getErrorString($lineBreak = "\n") {
      $error = '';
      if(sizeof($this->error)) {
        $error =  join($lineBreak, $this->error);
      }
      return $error;
    }

  }


?>